<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-script-type" content="text/javascript">
    <title></title>
    #parse("sys/header.html")
    <script src="${rc.contextPath}/statics/libs/ajaxupload.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            #if($shiro.hasPermission("firmware:save"))
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增遥控器固件</a>
            #end
            <a class="btn btn-primary" @click="openDrawer"><i class="fa fa-plus"></i>&nbsp;新增固件</a>
            #if($shiro.hasPermission("firmware:update"))
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            #end
            #if($shiro.hasPermission("firmware:delete"))
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            #end
        </div>
        <!-- 船体固件升级开始  抽屉-->

        <drawer
                title="固件上传"
                v-model="modelValue"
                width="50%"
                :styles="styles"
                :closable="false"
                :mask-closable="false"
        >
            <template>
                <Modal
                        v-model="modal6"
                        title="整包固件上传"
                        :loading="loading"
                        @on-ok="asyncOK">
                    <!--<template>-->
                        <i-progress :percent="percent" />
                        <!--<ButtonGroup size="large">-->
                            <!--<Button icon="ios-add" @click="circleAdd"></Button>-->
                            <!--<Button icon="ios-remove" @click="circleMinus"></Button>-->
                        <!--</ButtonGroup>-->
                    <!--</template>-->
                </Modal>
            </template>

            <div class="container-fluid" style="width: 45%">
                <div class="row">
                    <div>请选择标准的整机固件压缩包</div>
                </div>
                <div class="row">
                    <a class="btn btn-primary" id="pvw4Upload"><i class="fa fa-plus"></i>&nbsp;整机上传文件</a>
                </div>

                <div class="row">
                    <a class="btn btn-primary" id="tempUpdate"><i class="fa fa-plus"></i>单个固件zip（AP03_USB-1.0.9.zip）</a>
                </div>
                <!--<template>-->
                    <!--<div style="background:#eee;padding: 20px">-->
                        <!--<Card :bordered="false">-->
                            <!--<p slot="title">上传日志</p>-->
                            <!--<ul>-->
                                <!--<li v-for="(item, index) in firmware.uploadList">-->
                                    <!--<p>文件类型：${ item.fileParam } 文件路径 ：${ item.filePath } 文件大小： ${ item.fileSize }  </p>-->
                                <!--</li>-->
                            <!--</ul>-->

                        <!--</Card>-->
                    <!--</div>-->
                <!--</template>-->
                <div class="row">
                    <i-button type="warning" style="margin-right: 20px;" @click="modelValue = false">Cancel</i-button>
                    <!--<i-button type="primary" @click="confirmReceipt()">Confirm</i-button>-->
                </div>
            </div>

        </drawer>

        <!-- 船体固件升级结束  抽屉-->
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">

            <div class="form-group hidden">
                <div class="col-sm-2 control-label">唯一标识</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="fileId" v-model="firmware.rowId" placeholder="唯一标识"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">硬件类型</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.hardwareType" placeholder="硬件类型"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">硬件型号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.hardwareModel" placeholder="硬件型号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">固件最新版本号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control"  v-model="firmware.firmwareLatestVersionCode"
                           placeholder="固件最新版本号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">产品型号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.equipmentModel" placeholder="产品型号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">固件下载地址</div>
                <div class="col-sm-10">
                    <input type="text" id="downloadPath" readonly class="form-control"
                           v-model="firmware.firmwareDownloadAddr"
                           placeholder="固件下载地址"/>
                </div>

            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <a class="btn btn-primary" id="upload"><i class="fa fa-plus"></i>&nbsp;上传文件</a>
                </div>

            </div>
            <div class="form-group hidden">
                <div class="col-sm-2 control-label">信息录入时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.addTime" placeholder="信息录入时间"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">中文描述</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control hidden" v-model="firmware.firmwareDescription"
                           placeholder="固件描述信息"/>
                    <textarea class="form-control" id="zhDescription" rows="3" placeholder="中文描述">
                    </textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">英文描述</div>
                <div class="col-sm-10">
                    <textarea class="form-control" id="enDescription" rows="3" placeholder="英文描述">
                    </textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">日文描述</div>
                <div class="col-sm-10">
                    <textarea class="form-control" id="jaDescription" rows="3" placeholder="日文描述">
                    </textarea>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">合并版本号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.mergeVersion"
                           placeholder="合并版本号：DL01_1,MCU_1,WIFI_2"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">合并更新方式</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control hidden" v-model="firmware.updateMethod"
                           placeholder="更新方式0不强制、1强制"/>
                    <select class="form-control" id="isUpdateMethod" placeholder="是否强制升级">
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否强制升级</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control hidden" v-model="firmware.isMandatoryUpgrade"
                           placeholder="是否强制升级"/>
                    <select class="form-control" id="isMandatoryUpgradeSelect" placeholder="是否强制升级">
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">状态</div>
                <div class="col-sm-10">
                    <select class="form-control" id="isUseTo" placeholder="是否启用固件">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </div>
            </div>
            <div class="form-group  hidden">
                <div class="col-sm-2 control-label">固件大小</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="firmware.firmwareSize" placeholder="固件大小"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${rc.contextPath}/js/generator/firmware.js?_${date.systemTime}"></script>
</body>
</html>